{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Highcharts Demos\n",
    "==========\n",
    "Pie chart, line and column: http://www.highcharts.com/demo/pie-basic\n",
    "-----------------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;utf-8&quot; /&gt;\n",
       "        &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;/head&gt;\n",
       "    &lt;body style=&quot;margin:0;padding:0&quot;&gt;\n",
       "                &lt;div id=&quot;container&quot; style=&quot;width:850px;height:400px;&quot;&gt;Loading....&lt;/div&gt;\n",
       "\n",
       "\n",
       "    &lt;script&gt;\n",
       "        $(function(){\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "            Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}});\n",
       "            var option = {&quot;loading&quot;: {}, &quot;subtitle&quot;: {}, &quot;xAxis&quot;: {}, &quot;title&quot;: {&quot;text&quot;: &quot;Browser market shares at a specific website, 2014&quot;}, &quot;series&quot;: {}, &quot;labels&quot;: {}, &quot;yAxis&quot;: {}, &quot;chart&quot;: {&quot;width&quot;: 850, &quot;plotBackgroundColor&quot;: null, &quot;plotShadow&quot;: false, &quot;renderTo&quot;: &quot;container&quot;, &quot;plotBorderWidth&quot;: null, &quot;height&quot;: 400}, &quot;tooltip&quot;: {&quot;pointFormat&quot;: &quot;{series.name}: &lt;b&gt;{point.percentage:.1f}%&lt;/b&gt;&quot;}, &quot;plotOptions&quot;: {}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;colors&quot;: {}, &quot;pane&quot;: {}, &quot;exporting&quot;: {}, &quot;drilldown&quot;: {}, &quot;navigation&quot;: {}, &quot;legend&quot;: {}};\n",
       "\n",
       "\n",
       "            var data = [{&quot;name&quot;: &quot;Browser share&quot;, &quot;type&quot;: &quot;pie&quot;, &quot;dataLabels&quot;: {&quot;style&quot;: {&quot;color&quot;: (Highcharts.theme &amp;&amp; Highcharts.theme.contrastTextColor) || &#x27;black&#x27;}, &quot;enabled&quot;: false, &quot;format&quot;: &quot;&lt;b&gt;{point.name}&lt;/b&gt;: {point.percentage:.1f} %&quot;}, &quot;cursor&quot;: &quot;pointer&quot;, &quot;allowPointSelect&quot;: true, &quot;data&quot;: [{&quot;y&quot;: 56.33, &quot;name&quot;: &quot;Microsoft Internet Explorer&quot;}, {&quot;y&quot;: 24.03, &quot;sliced&quot;: true, &quot;selected&quot;: true, &quot;name&quot;: &quot;Chrome&quot;}, {&quot;y&quot;: 10.38, &quot;name&quot;: &quot;Firefox&quot;}, {&quot;y&quot;: 4.77, &quot;name&quot;: &quot;Safari&quot;}, {&quot;y&quot;: 0.91, &quot;name&quot;: &quot;Opera&quot;}, {&quot;y&quot;: 0.2, &quot;name&quot;: &quot;Proprietary or Undetectable&quot;}], &quot;showInLegend&quot;: true}]\n",
       "            option.series = data;\n",
       "\n",
       " \n",
       "\n",
       "            var chart = new Highcharts.Chart(option);\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "        \n",
       "    });\n",
       "        &lt;/script&gt;\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\" height=400 width=850></iframe>"
      ],
      "text/plain": [
       "<highcharts.highcharts.highcharts.Highchart at 0x7ff140177f90>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import datetime\n",
    "from highcharts import Highchart\n",
    "\n",
    "H = Highchart(width=850, height=400)\n",
    "\n",
    "data = [{\n",
    "        'name': \"Microsoft Internet Explorer\",\n",
    "        'y': 56.33\n",
    "    }, {\n",
    "        'name': \"Chrome\",\n",
    "        'y': 24.03,\n",
    "        'sliced': True,\n",
    "        'selected': True\n",
    "    }, {\n",
    "        'name': \"Firefox\",\n",
    "        'y': 10.38\n",
    "    }, {\n",
    "        'name': \"Safari\",\n",
    "        'y': 4.77\n",
    "    }, {\n",
    "        'name': \"Opera\",\n",
    "        'y': 0.91\n",
    "    }, {\n",
    "        'name': \"Proprietary or Undetectable\",\n",
    "        'y': 0.2\n",
    "    }]\n",
    "    \n",
    "options = {\n",
    "        'chart': {\n",
    "            'plotBackgroundColor': None,\n",
    "            'plotBorderWidth': None,\n",
    "            'plotShadow': False\n",
    "        },\n",
    "        'title': {\n",
    "            'text': 'Browser market shares at a specific website, 2014'\n",
    "        },\n",
    "        'tooltip': {\n",
    "            'pointFormat': '{series.name}: <b>{point.percentage:.1f}%</b>'\n",
    "        },\n",
    "    }\n",
    "\n",
    "H.set_dict_options(options)\n",
    "\n",
    "H.add_data_set(data, 'pie', 'Browser share', allowPointSelect=True,\n",
    "                cursor='pointer',\n",
    "                showInLegend=True,\n",
    "                dataLabels={\n",
    "                    'enabled': False,\n",
    "                    'format': '<b>{point.name}</b>: {point.percentage:.1f} %',\n",
    "                    'style': {\n",
    "                        'color': \"(Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'\"\n",
    "                    }\n",
    "                }\n",
    "            )\n",
    "\n",
    "H"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
